import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionAdapter;
public class MouseMotionHandler extends MouseMotionAdapter
{
	Game game;
	int mouseX;
	int mouseY;
	public boolean leftClick;

	public MouseMotionHandler(Game g) {
		super();
		this.game = g;
	}

	@Override
	public void mouseMoved(MouseEvent e) 
	{
		mouseX = e.getX();
		mouseY = e.getY();
		game.laser.updatePosition(game, mouseX, mouseY);
		super.mouseMoved(e);
	} 
	@Override
	public void mouseDragged(MouseEvent e) {

		if (game.leftClick == true)
		{
			mouseX = e.getX();
			mouseY = e.getY();
			game.laser.updatePosition(game, mouseX, mouseY);
			game.freezeAt(mouseX - 400 + game.player.x, mouseY - 300 + game.player.y);
		} else if (game.rightClick == true)
		{
			mouseX = e.getX();
			mouseY = e.getY();
			game.laser.updatePosition(game, mouseX, mouseY);
			game.meltAt(mouseX - 400 + game.player.x, mouseY - 300 + game.player.y);
		}
	}
}
